<template>
  <div>
    <ul>
      <li v-for="item in users" :key="item.name" @click="go(item.name)">
        {{item.name}}
      </li>
    </ul>
  </div>

</template>

<script>
export default {
  data () {
    return {
      users: []
    }
  },
  created () {
    let that = this
    wx.request({
      // url: 'https://www.easy-mock.com/mock/5c83d42e6ed1b709ab872b59/ugwxcloud/test',
      url: 'https://www.easy-mock.com/mock/5c83d42e6ed1b709ab872b59/ugwxcloud/users',
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        that.users = res.data.data
      }
    })
  },
  methods: {
    go (name) {
      const url = `../user/main?name=${name}`
      wx.navigateTo({url})
    }
  }
}
</script>

